<script setup lang="ts">
import { computed } from 'vue';
import { resolveFileIcon } from '../assets/fileIcons';

const props = defineProps({
  name: { type: String, default: '' }, // filename or absolute path
  size: { type: Number, default: 14 },
  isDir: { type: Boolean, default: false },
});

const src = computed(() => resolveFileIcon(props.name, { isDir: props.isDir }));
</script>

<script lang="ts">
export default {
  name: 'FileIcon',
};
</script>

<template>
  <img :src="src" :width="size" :height="size" alt="file" />
</template>


